
/*

    This class deals with the color of Xlib
*/



#ifndef COLOR_H
#define COLOR_H

#include <X11/Xlib.h>
#include "MyDisplay.h"

using namespace std;


class Color{

  
 Colormap screenColormap;     /* color map to use for allocating colors.   */
 //Display &display;
 //GC gc;
 
 MyDisplay *show;
 XColor screenColor;
				/* used for allocation of the given color    */
				/* map entries.                              */ 

  
public:     
       
    Color(Color &another);
    Color(const MyDisplay &another ,short red,short green,short blue);
    Color(const MyDisplay &another);
   
    
    ~Color();
   
    
    unsigned long pixel();
     
    unsigned short red();
    
    unsigned short green();
    
    unsigned short blue();
    
    
 //this method will set the background color of Xlib window
 void setBackgroundColor( Color &c);
 
 
   void setBackgroundColor( short red,short green,short blue);  
    
 //This method will set the drawing color of the Xlib window     
   void setForegroundColor(Color &c); 
   
   void setForegroundColor( short red,short green,short blue); 
 //This method will return the color which has set for background color  
   Color  getBackgroundColor() ;
   
 //This method will return the drawing color of the window   
   Color  getForegroundColor() ;
   
 //This Method will return color from the screen
  //Color getColor();   

 private :
 
    void setColor(short red,short green,short blue);     
    void freeColor();  

};	



#endif //COLOR_H

